package com.awise.util;

/**
 * Created by lgz on 2018/1/23.
 */

public class Utils {

    public static String formatTime(byte[] time) {
        int hour = time[0];
        int minute = time[1];
        StringBuilder result = new StringBuilder();
        if (hour < 10) {
            result.append(0);
        }
        result.append(hour);
        result.append(":");
        if (minute < 10) {
            result.append(0);
        }
        result.append(minute);
        return result.toString();
    }

  /*
    十进制转化为十六进制，结果为C8。
     Integer.toHexString(200);
    十六进制转化为十进制，结果140。
    Integer.parseInt("8C",16);*/


    public static byte Int10to16(int progress){
      int value= Integer.valueOf(Integer.toHexString(progress));
    return (byte)value;
    }

    public static int Int16to10(String value){
        return Integer.parseInt(value,16);
    }
}